Language="VBSCRIPT"

Sub CATMain()

Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument

Dim part1 As Part
Set part1 = partDocument1.Part

Dim originElements1 As OriginElements
Set originElements1 = part1.OriginElements

Dim hybridShapePlaneExplicit1 As AnyObject
Set hybridShapePlaneExplicit1 = originElements1.PlaneXY

Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(hybridShapePlaneExplicit1)

Dim bodies1 As Bodies
Set bodies1 = part1.Bodies

Dim body1 As Body
Set body1 = bodies1.Item("PartBody")

Dim hybridShapes1 As HybridShapes
Set hybridShapes1 = body1.HybridShapes

Dim hybridShapeLineExplicit1 As HybridShape
Set hybridShapeLineExplicit1 = hybridShapes1.Item("X Axis")

Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(hybridShapeLineExplicit1)

Dim hybridShapeFactory1 As Factory
Set hybridShapeFactory1 = part1.HybridShapeFactory

Dim hybridShapePlaneAngle1 As HybridShapePlaneAngle
Set hybridShapePlaneAngle1 = hybridShapeFactory1.AddNewPlaneAngle(reference1, reference2, 45.000000, False)

hybridShapePlaneAngle1.ProjectionMode = False

body1.InsertHybridShape hybridShapePlaneAngle1

part1.InWorkObject = hybridShapePlaneAngle1

part1.Update 

End Sub
